/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lihle.designpatterns.model.creational.singleton;

import java.util.Date;

/**
 *
 * @author user
 */
public class Singleton {
    
    private static Singleton singletonExample = null;
    private String  word = "Hello";
    private Date d = new Date();
    private Singleton(){}
    
    public static Singleton getInstance(){
        
        if(singletonExample == null) {
            singletonExample = new Singleton();
        }
        return singletonExample;
    }
    public String sayHello(){
       // System.out.println("Hello");
       return word;
    }
    public Date getDate(){
    
        return d;
    }
}
